#pragma once

#include "vrdatacore_global.h"
#include "drawableactor.h"
#include "commonshape.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT TerrainBrushActor:public DrawableActor
	{
	public:
		TerrainBrushActor(void);
		enum BrushType
		{
			NONE,
			VEGETATION,
			CLEAR_VEGETATION,
		};
		enum BrushShape
		{
			RECT,
			CIRCLE,
		};
		enum PlantType
		{
			TREE,
			GRASS,
		};
	protected:
		virtual ~TerrainBrushActor(void);
		virtual void createDrawable();
		virtual void initialNode();
		osg::ref_ptr<CoreBase::LineRectShape>			_rectShape;
		osg::ref_ptr<CoreBase::CircleShape>				_circleShape;
		BrushType										_brushType;
		BrushShape										_brushShape;
		float											_width;
		int												_density;
		QStringList										_plantObjects;
		bool											_collisionOn;
		PlantType										_plantType;
	public:
		virtual void buildPropertyMap();
		virtual void onMapLoadEnd(CoreBase::Map*);
		void setBrushType(BrushType type);
		BrushType getBrushType() const;
		void setBrushShape(BrushShape shape);
		BrushShape getBrushShape() const;
		void setWidth(float width);
		float getWidth();
		virtual osg::ref_ptr<CoreBase::ActorBase> clone();
		void setDensity(int value);
		int getDensity();
		void setPlantObjects(const QStringList& meshfilename,PlantType type,bool collision = false);
		QStringList getPlantObjects();
		bool getCollisionOn();
		PlantType getPlantType();
	};
}